コード例 #1
0
 /**
  * Fill VideoStream from array.
  *
  * @param array $options Array containing values for object properties
  */
 public function fromArray($options)
 {
     if (isset($options['Index'])) {
         Validate::isInteger($options['Index'], 'options[Index]');
         $this->_index = (int) $options['Index'];
     }
 }
コード例 #2
0
 /**
  * Fill ChannelOutputHls from array.
  *
  * @param array $options Array containing values for object properties
  */
 public function fromArray($options)
 {
     if (isset($options['FragmentsPerSegment'])) {
         Validate::isInteger($options['FragmentsPerSegment'], 'options[FragmentsPerSegment]');
         $this->_fragmentsPerSegment = (int) $options['FragmentsPerSegment'];
     }
 }
コード例 #3
0
ファイル: ErrorDetail.php プロジェクト: mat33470/PFA
 /**
  * Fill error detail from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['Code'])) {
         Validate::isInteger($options['Code'], 'options[Code]');
         $this->_code = $options['Code'];
     }
     if (isset($options['Message'])) {
         Validate::isString($options['Message'], 'options[Message]');
         $this->_message = $options['Message'];
     }
 }
コード例 #4
0
 /**
  * Fill EncodingReservedUnitType from array.
  *
  * @param array $options Array containing values for object properties
  */
 public function fromArray($options)
 {
     if (isset($options['AccountId'])) {
         Validate::isString($options['AccountId'], 'options[AccountId]');
         $this->_accountId = $options['AccountId'];
     }
     if (isset($options['ReservedUnitType'])) {
         Validate::isInteger($options['ReservedUnitType'], 'options[ReservedUnitType]');
         $this->_reservedUnitType = intval($options['ReservedUnitType']);
     }
     if (isset($options['MaxReservableUnits'])) {
         Validate::isInteger($options['MaxReservableUnits'], 'options[MaxReservableUnits]');
         $this->_maxReservableUnits = intval($options['MaxReservableUnits']);
     }
     if (isset($options['CurrentReservedUnits'])) {
         Validate::isString($options['CurrentReservedUnits'], 'options[CurrentReservedUnits]');
         $this->_currentReservedUnits = intval($options['CurrentReservedUnits']);
     }
 }
コード例 #5
0
 /**
  * Adds status code to the expected status codes.
  * 
  * @param integer $statusCode The expected status code.
  * 
  * @return none
  */
 public function addStatusCode($statusCode)
 {
     Validate::isInteger($statusCode, 'statusCode');
     $this->_statusCodes[] = $statusCode;
 }
コード例 #6
0
 /**
  * Fill task historical event from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['Code'])) {
         Validate::isInteger($options['Code'], 'options[Code]');
         $this->_code = $options['Code'];
     }
     if (isset($options['Message'])) {
         Validate::isString($options['Message'], 'options[Message]');
         $this->_message = $options['Message'];
     }
     if (isset($options['TimeStamp'])) {
         Validate::isDateString($options['TimeStamp'], 'options[TimeStamp]');
         $this->_timeStamp = new \DateTime($options['TimeStamp']);
     }
 }
コード例 #7
0
 /**
  * Sets rangeEnd
  * 
  * @param integer $rangeEnd range end value in bytes
  * 
  * @return none
  */
 public function setRangeEnd($rangeEnd)
 {
     Validate::isInteger($rangeEnd, 'rangeEnd');
     $this->_rangeEnd = $rangeEnd;
 }
コード例 #8
0
 /**
  * The GetProtectionKeyId function retrieves an X.509 certificate thumbprint that
  * is used to ensure that you have the correct certificate installed on your
  * machine when encrypting your user-defined content key.
  *
  * @param int $contentKeyType ContentKey type
  *
  * @return string
  */
 public function getProtectionKeyId($contentKeyType)
 {
     Validate::isInteger($contentKeyType, 'contentKeyType');
     $method = Resources::HTTP_GET;
     $path = "GetProtectionKeyId?contentKeyType={$contentKeyType}";
     $headers = array();
     $postParams = array();
     $queryParams = array();
     $statusCode = Resources::STATUS_OK;
     $response = $this->send($method, $headers, $postParams, $queryParams, $path, $statusCode);
     return (string) simplexml_load_string($response->getBody());
 }
コード例 #9
0
ファイル: Job.php プロジェクト: bitmovin/azure-sdk-for-php
 /**
  * Fill asset from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['Created'])) {
         Validate::isDateString($options['Created'], 'options[Created]');
         $this->_created = new \DateTime($options['Created']);
     }
     if (isset($options['LastModified'])) {
         Validate::isDateString($options['LastModified'], 'options[LastModified]');
         $this->_lastModified = new \DateTime($options['LastModified']);
     }
     if (isset($options['EndTime'])) {
         Validate::isDateString($options['EndTime'], 'options[EndTime]');
         $this->_endTime = new \DateTime($options['EndTime']);
     }
     if (isset($options['Priority'])) {
         Validate::isInteger($options['Priority'], 'options[Priority]');
         $this->_priority = $options['Priority'];
     }
     if (isset($options['RunningDuration'])) {
         Validate::isDouble($options['RunningDuration'], 'options[RunningDuration]');
         $this->_runningDuration = $options['RunningDuration'];
     }
     if (isset($options['StartTime'])) {
         Validate::isDateString($options['StartTime'], 'options[StartTime]');
         $this->_startTime = new \DateTime($options['StartTime']);
     }
     if (isset($options['State'])) {
         Validate::isInteger($options['State'], 'options[State]');
         $this->_state = $options['State'];
     }
     if (isset($options['TemplateId'])) {
         Validate::isString($options['TemplateId'], 'options[TemplateId]');
         $this->_templateId = $options['TemplateId'];
     }
 }
コード例 #10
0
 /**
  * Fill access policy from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['Created'])) {
         Validate::isDateString($options['Created'], 'options[Created]');
         $this->_created = new \DateTime($options['Created']);
     }
     if (isset($options['LastModified'])) {
         Validate::isDateString($options['LastModified'], 'options[LastModified]');
         $this->_lastModified = new \DateTime($options['LastModified']);
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['DurationInMinutes'])) {
         Validate::isDouble($options['DurationInMinutes'], 'options[DurationInMinutes]');
         $this->_durationInMinutes = $options['DurationInMinutes'];
     }
     if (isset($options['Permissions'])) {
         Validate::isInteger($options['Permissions'], 'options[Permissions]');
         $this->_permissions = $options['Permissions'];
     }
 }
コード例 #11
0
 /**
  * Updates the visibility timeout of a message and/or the message contents.
  * 
  * @param string              $queueName                  The queue name.
  * @param string              $messageId                  The id of the message.
  * @param string              $popReceipt                 The valid pop receipt 
  * value returned from an earlier call to the Get Messages or Update Message
  * operation.
  * @param string              $messageText                The message contents.
  * @param int                 $visibilityTimeoutInSeconds Specifies the new 
  * visibility timeout value, in seconds, relative to server time. 
  * The new value must be larger than or equal to 0, and cannot be larger 
  * than 7 days. The visibility timeout of a message cannot be set to a value 
  * later than the expiry time. A message can be updated until it has been 
  * deleted or has expired.
  * @param QueueServiceOptions $options                    The optional 
  * parameters.
  * 
  * @return WindowsAzure\Common\Models\UpdateMessageResult
  */
 public function updateMessage($queueName, $messageId, $popReceipt, $messageText, $visibilityTimeoutInSeconds, $options = null)
 {
     Validate::isString($queueName, 'queueName');
     Validate::notNullOrEmpty($queueName, 'queueName');
     Validate::isString($messageId, 'messageId');
     Validate::notNullOrEmpty($messageId, 'messageId');
     Validate::isString($popReceipt, 'popReceipt');
     Validate::notNullOrEmpty($popReceipt, 'popReceipt');
     Validate::isString($messageText, 'messageText');
     Validate::isInteger($visibilityTimeoutInSeconds, 'visibilityTimeoutInSeconds');
     Validate::notNull($visibilityTimeoutInSeconds, 'visibilityTimeoutInSeconds');
     $method = Resources::HTTP_PUT;
     $headers = array();
     $postParams = array();
     $queryParams = array();
     $path = $queueName . '/messages' . '/' . $messageId;
     $body = Resources::EMPTY_STRING;
     $statusCode = Resources::STATUS_NO_CONTENT;
     if (is_null($options)) {
         $options = new QueueServiceOptions();
     }
     $this->addOptionalQueryParam($queryParams, Resources::QP_VISIBILITY_TIMEOUT, $visibilityTimeoutInSeconds);
     $this->addOptionalQueryParam($queryParams, Resources::QP_TIMEOUT, $options->getTimeout());
     $this->addOptionalQueryParam($queryParams, Resources::QP_POPRECEIPT, $popReceipt);
     if (!empty($messageText)) {
         $this->addOptionalHeader($headers, Resources::CONTENT_TYPE, Resources::URL_ENCODED_CONTENT_TYPE);
         $message = new QueueMessage();
         $message->setMessageText($messageText);
         $body = $message->toXml($this->dataSerializer);
     }
     $response = $this->send($method, $headers, $queryParams, $postParams, $path, $statusCode, $body);
     $popReceipt = $response->getHeader(Resources::X_MS_POPRECEIPT);
     $timeNextVisible = $response->getHeader(Resources::X_MS_TIME_NEXT_VISIBLE);
     $date = Utilities::rfc1123ToDateTime($timeNextVisible);
     $result = new UpdateMessageResult();
     $result->setPopReceipt($popReceipt);
     $result->setTimeNextVisible($date);
     return $result;
 }
コード例 #12
0
 /**
  * Fill job template from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['Created'])) {
         Validate::isDateString($options['Created'], 'options[Created]');
         $this->_created = new \DateTime($options['Created']);
     }
     if (isset($options['LastModified'])) {
         Validate::isDateString($options['LastModified'], 'options[LastModified]');
         $this->_lastModified = new \DateTime($options['LastModified']);
     }
     if (isset($options['JobTemplateBody'])) {
         Validate::isString($options['JobTemplateBody'], 'options[JobTemplateBody]');
         $this->_jobTemplateBody = $options['JobTemplateBody'];
     }
     if (isset($options['NumberofInputAssets'])) {
         Validate::isInteger($options['NumberofInputAssets'], 'options[NumberofInputAssets]');
         $this->_numberofInputAssets = $options['NumberofInputAssets'];
     }
     if (isset($options['TemplateType'])) {
         Validate::isInteger($options['TemplateType'], 'options[TemplateType]');
         $this->_templateType = $options['TemplateType'];
     }
 }
コード例 #13
0
 /**
  * Fill task template from array.
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['Configuration'])) {
         Validate::isString($options['Configuration'], 'options[Configuration]');
         $this->_configuration = $options['Configuration'];
     }
     if (isset($options['Created'])) {
         Validate::isDateString($options['Created'], 'options[Created]');
         $this->_created = new \DateTime($options['Created']);
     }
     if (isset($options['Description'])) {
         Validate::isString($options['Description'], 'options[Description]');
         $this->_description = $options['Description'];
     }
     if (isset($options['LastModified'])) {
         Validate::isDateString($options['LastModified'], 'options[LastModified]');
         $this->_lastModified = new \DateTime($options['LastModified']);
     }
     if (isset($options['MediaProcessorId'])) {
         Validate::isString($options['MediaProcessorId'], 'options[MediaProcessorId]');
         $this->_mediaProcessorId = $options['MediaProcessorId'];
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['NumberofInputAssets'])) {
         Validate::isInteger($options['NumberofInputAssets'], 'options[NumberofInputAssets]');
         $this->_numberofInputAssets = $options['NumberofInputAssets'];
     }
     if (isset($options['NumberofOutputAssets'])) {
         Validate::isInteger($options['NumberofOutputAssets'], 'options[NumberofOutputAssets]');
         $this->_numberofOutputAssets = $options['NumberofOutputAssets'];
     }
     if (isset($options['Options'])) {
         Validate::isInteger($options['Options'], 'options[Options]');
         $this->_options = $options['Options'];
     }
     if (isset($options['EncryptionKeyId'])) {
         Validate::isString($options['EncryptionKeyId'], 'options[EncryptionKeyId]');
         $this->_encryptionKeyId = $options['EncryptionKeyId'];
     }
     if (isset($options['EncryptionScheme'])) {
         Validate::isString($options['EncryptionScheme'], 'options[EncryptionScheme]');
         $this->_encryptionScheme = $options['EncryptionScheme'];
     }
     if (isset($options['EncryptionVersion'])) {
         Validate::isString($options['EncryptionVersion'], 'options[EncryptionVersion]');
         $this->_encryptionVersion = $options['EncryptionVersion'];
     }
     if (isset($options['InitializationVector'])) {
         Validate::isString($options['InitializationVector'], 'options[InitializationVector]');
         $this->_initializationVector = $options['InitializationVector'];
     }
 }
コード例 #14
0
 /**
  * Fill ContentKeyAuthorizationPolicyOption from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return void
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['KeyDeliveryType'])) {
         Validate::isInteger($options['KeyDeliveryType'], 'options[KeyDeliveryType]');
         $this->_keyDeliveryType = $options['KeyDeliveryType'];
     }
     if (isset($options['KeyDeliveryConfiguration'])) {
         Validate::isString($options['KeyDeliveryConfiguration'], 'options[KeyDeliveryConfiguration]');
         $this->_keyDeliveryConfiguration = $options['KeyDeliveryConfiguration'];
     }
     if (!empty($options['Restrictions'])) {
         Validate::isArray($options['Restrictions'], 'options[Restrictions]');
         foreach ($options['Restrictions'] as $restriction) {
             $this->_restrictions[] = ContentKeyAuthorizationPolicyRestriction::createFromOptions($restriction);
         }
     }
 }
コード例 #15
0
ファイル: Task.php プロジェクト: mat33470/PFA
 /**
  * Fill task from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['Configuration'])) {
         Validate::isString($options['Configuration'], 'options[Configuration]');
         $this->_configuration = $options['Configuration'];
     }
     if (isset($options['EndTime'])) {
         Validate::isDateString($options['EndTime'], 'options[EndTime]');
         $this->_endTime = new \DateTime($options['EndTime']);
     }
     if (isset($options['MediaProcessorId'])) {
         Validate::isString($options['MediaProcessorId'], 'options[MediaProcessorId]');
         $this->_mediaProcessorId = $options['MediaProcessorId'];
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['PerfMessage'])) {
         Validate::isString($options['PerfMessage'], 'options[PerfMessage]');
         $this->_perfMessage = $options['PerfMessage'];
     }
     if (isset($options['Priority'])) {
         Validate::isInteger($options['Priority'], 'options[Priority]');
         $this->_priority = $options['Priority'];
     }
     if (isset($options['Progress'])) {
         Validate::isDouble($options['Progress'], 'options[Progress]');
         $this->_progress = $options['Progress'];
     }
     if (isset($options['RunningDuration'])) {
         Validate::isDouble($options['RunningDuration'], 'options[RunningDuration]');
         $this->_runningDuration = $options['RunningDuration'];
     }
     if (isset($options['StartTime'])) {
         Validate::isDateString($options['StartTime'], 'options[StartTime]');
         $this->_startTime = new \DateTime($options['StartTime']);
     }
     if (isset($options['State'])) {
         Validate::isInteger($options['State'], 'options[State]');
         $this->_state = $options['State'];
     }
     if (isset($options['TaskBody'])) {
         Validate::isString($options['TaskBody'], 'options[TaskBody]');
         $this->_taskBody = $options['TaskBody'];
     }
     if (isset($options['Options'])) {
         Validate::isInteger($options['Options'], 'options[Options]');
         $this->_options = $options['Options'];
     }
     if (isset($options['EncryptionKeyId'])) {
         Validate::isString($options['EncryptionKeyId'], 'options[EncryptionKeyId]');
         $this->_encryptionKeyId = $options['EncryptionKeyId'];
     }
     if (isset($options['EncryptionScheme'])) {
         Validate::isString($options['EncryptionScheme'], 'options[EncryptionScheme]');
         $this->_encryptionScheme = $options['EncryptionScheme'];
     }
     if (isset($options['EncryptionVersion'])) {
         Validate::isString($options['EncryptionVersion'], 'options[EncryptionVersion]');
         $this->_encryptionVersion = $options['EncryptionVersion'];
     }
     if (isset($options['InitializationVector'])) {
         Validate::isString($options['InitializationVector'], 'options[InitializationVector]');
         $this->_initializationVector = $options['InitializationVector'];
     }
     if (isset($options['ErrorDetails'])) {
         $this->_errorDetails = array();
         if (is_array($options['ErrorDetails'])) {
             foreach ($options['ErrorDetails'] as $errorDetail) {
                 $this->_errorDetails[] = ErrorDetail::createFromOptions($errorDetail);
             }
         }
     }
     if (isset($options['HistoricalEvents'])) {
         $this->_historicalEvents = array();
         if (is_array($options['HistoricalEvents'])) {
             foreach ($options['HistoricalEvents'] as $historicalEvent) {
                 $evnt = TaskHistoricalEvent::createFromOptions($historicalEvent);
                 $this->_historicalEvents[] = $evnt;
             }
         }
     }
 }
コード例 #16
0
 /**
  * Fill manifest file from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['EncryptionVersion'])) {
         Validate::isString($options['EncryptionVersion'], 'options[EncryptionVersion]');
         $this->_encryptionVersion = $options['EncryptionVersion'];
     }
     if (isset($options['EncryptionScheme'])) {
         Validate::isString($options['EncryptionScheme'], 'options[EncryptionScheme]');
         $this->_encryptionScheme = $options['EncryptionScheme'];
     }
     if (isset($options['IsEncrypted'])) {
         Validate::isBoolean($options['IsEncrypted'], 'options[IsEncrypted]');
         $this->_isEncrypted = $options['IsEncrypted'];
     }
     if (isset($options['EncryptionKeyId'])) {
         Validate::isString($options['EncryptionKeyId'], 'options[EncryptionKeyId]');
         $this->_encryptionKeyId = $options['EncryptionKeyId'];
     }
     if (isset($options['InitializationVector'])) {
         Validate::isString($options['InitializationVector'], 'options[InitializationVector]');
         $this->_initializationVector = $options['InitializationVector'];
     }
     if (isset($options['IsPrimary'])) {
         Validate::isBoolean($options['IsPrimary'], 'options[IsPrimary]');
         $this->_isPrimary = $options['IsPrimary'];
     }
     if (isset($options['LastModified'])) {
         Validate::isDateString($options['LastModified'], 'options[LastModified]');
         $this->_lastModified = new \DateTime($options['LastModified']);
     }
     if (isset($options['Created'])) {
         Validate::isDateString($options['Created'], 'options[Created]');
         $this->_created = new \DateTime($options['Created']);
     }
     if (isset($options['MimeType'])) {
         Validate::isString($options['MimeType'], 'options[MimeType]');
         $this->_mimeType = $options['MimeType'];
     }
     if (isset($options['State'])) {
         Validate::isInteger($options['State'], 'options[State]');
         $this->_state = $options['State'];
     }
     if (isset($options['ParentIngestManifestId'])) {
         Validate::isString($options['ParentIngestManifestId'], 'options[ParentIngestManifestId]');
         $this->_parentIngestManifestId = $options['ParentIngestManifestId'];
     }
     if (isset($options['ParentIngestManifestAssetId'])) {
         Validate::isString($options['ParentIngestManifestAssetId'], 'options[ParentIngestManifestAssetId]');
         $id = $options['ParentIngestManifestAssetId'];
         $this->_parentIngestManifestAssetId = $id;
     }
     if (isset($options['ErrorDetail'])) {
         Validate::isString($options['ErrorDetail'], 'options[ErrorDetail]');
         $this->_errorDetail = $options['ErrorDetail'];
     }
 }
コード例 #17
0
 /**
  * Sets blob blobContentLength.
  *
  * @param integer $blobContentLength value.
  *
  * @return none.
  */
 public function setBlobContentLength($blobContentLength)
 {
     Validate::isInteger($blobContentLength, 'blobContentLength');
     $this->_blobContentLength = $blobContentLength;
 }
コード例 #18
0
 /**
  * Specifies the next upgrade domain to be walked during manual in-place upgrade
  * or configuration change.
  *
  * Note that you can walk an upgrade domain either by specifying the deployment
  * environment (staging or production), or by specifying the deployment's unique
  * name.
  *
  * @param string               $name          The hosted service name.
  * @param integer              $upgradeDomain The integer value that
  * identifies the upgrade domain to walk. Upgrade domains are identified with a
  * zero-based index: the first upgrade domain has an ID of 0, the second has an
  * ID of 1, and so on.
  * @param GetDeploymentOptions $options       The optional parameters.
  *
  * @return AsynchronousOperationResult
  *
  * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee460800.aspx
  */
 public function walkUpgradeDomain($name, $upgradeDomain, $options)
 {
     Validate::isString($name, 'name');
     Validate::notNullOrEmpty($name, 'name');
     Validate::isInteger($upgradeDomain, 'upgradeDomain');
     Validate::notNullOrEmpty($options, 'options');
     $body = $this->_createRequestXml(array(Resources::XTAG_UPGRADE_DOMAIN => $upgradeDomain), Resources::XTAG_WALK_UPGRADE_DOMAIN);
     $context = new HttpCallContext();
     $context->setMethod(Resources::HTTP_POST);
     $context->setPath($this->_getDeploymentPath($name, $options) . '/');
     $context->addStatusCode(Resources::STATUS_ACCEPTED);
     $context->addQueryParameter(Resources::QP_COMP, Resources::QPV_WALK_UPGRADE_DOMAIN);
     $context->setBody($body);
     $context->addHeader(Resources::CONTENT_TYPE, Resources::XML_CONTENT_TYPE);
     assert(Utilities::endsWith($context->getPath(), '/'));
     $response = $this->sendContext($context);
     return AsynchronousOperationResult::create($response->getHeader());
 }
コード例 #19
0
 /**
  * Sets max results.
  *
  * @param integer $maxResults value.
  * 
  * @return none.
  */
 public function setMaxResults($maxResults)
 {
     Validate::isInteger($maxResults, 'maxResults');
     $this->_maxResults = $maxResults;
 }
コード例 #20
0
 /**
  * Fill ManifestStatistics from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['PendingFilesCount'])) {
         Validate::isInteger($options['PendingFilesCount'], 'options[PendingFilesCount]');
         $this->_pendingFilesCount = $options['PendingFilesCount'];
     }
     if (isset($options['FinishedFilesCount'])) {
         Validate::isInteger($options['FinishedFilesCount'], 'options[FinishedFilesCount]');
         $this->_finishedFilesCount = $options['FinishedFilesCount'];
     }
     if (isset($options['ErrorFilesCount'])) {
         Validate::isInteger($options['ErrorFilesCount'], 'options[ErrorFilesCount]');
         $this->_errorFilesCount = $options['ErrorFilesCount'];
     }
     if (isset($options['ErrorFilesDetails'])) {
         Validate::isString($options['ErrorFilesDetails'], 'options[ErrorFilesDetails]');
         $this->_errorFilesDetails = $options['ErrorFilesDetails'];
     }
 }
コード例 #21
0
 /**
  * Fill contentKey from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['Created'])) {
         Validate::isDateString($options['Created'], 'options[Created]');
         $this->_created = new \DateTime($options['Created']);
     }
     if (isset($options['LastModified'])) {
         Validate::isDateString($options['LastModified'], 'options[LastModified]');
         $this->_lastModified = new \DateTime($options['LastModified']);
     }
     if (isset($options['ContentKeyType'])) {
         Validate::isInteger($options['ContentKeyType'], 'options[ContentKeyType]');
         $this->_contentKeyType = $options['ContentKeyType'];
     }
     if (isset($options['EncryptedContentKey'])) {
         Validate::isString($options['EncryptedContentKey'], 'options[EncryptedContentKey]');
         $this->_encryptedContentKey = $options['EncryptedContentKey'];
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['ProtectionKeyId'])) {
         Validate::isString($options['ProtectionKeyId'], 'options[ProtectionKeyId]');
         $this->_protectionKeyId = $options['ProtectionKeyId'];
     }
     if (isset($options['ProtectionKeyType'])) {
         Validate::isInteger($options['ProtectionKeyType'], 'options[ProtectionKeyType]');
         $this->_protectionKeyType = $options['ProtectionKeyType'];
     }
     if (isset($options['Checksum'])) {
         Validate::isString($options['Checksum'], 'options[Checksum]');
         $this->_checksum = $options['Checksum'];
     }
 }
コード例 #22
0
ファイル: BlobRestProxy.php プロジェクト: yszar/linuxwp
 /**
  * Creates a new page blob. Note that calling createPageBlob to create a page
  * blob only initializes the blob.
  * To add content to a page blob, call createBlobPages method.
  * 
  * @param string                   $container The container name.
  * @param string                   $blob      The blob name.
  * @param integer                  $length    Specifies the maximum size for the
  * page blob, up to 1 TB. The page blob size must be aligned to a 512-byte 
  * boundary.
  * @param Models\CreateBlobOptions $options   The optional parameters.
  * 
  * @return CopyBlobResult
  * 
  * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179451.aspx
  */
 public function createPageBlob($container, $blob, $length, $options = null)
 {
     Validate::isString($container, 'container');
     Validate::isString($blob, 'blob');
     Validate::notNullOrEmpty($blob, 'blob');
     Validate::isInteger($length, 'length');
     Validate::notNull($length, 'length');
     $method = Resources::HTTP_PUT;
     $headers = array();
     $postParams = array();
     $queryParams = array();
     $path = $this->_createPath($container, $blob);
     $statusCode = Resources::STATUS_CREATED;
     if (is_null($options)) {
         $options = new CreateBlobOptions();
     }
     $this->addOptionalHeader($headers, Resources::X_MS_BLOB_TYPE, BlobType::PAGE_BLOB);
     $this->addOptionalHeader($headers, Resources::X_MS_BLOB_CONTENT_LENGTH, $length);
     $this->addOptionalHeader($headers, Resources::X_MS_BLOB_SEQUENCE_NUMBER, $options->getSequenceNumber());
     $headers = $this->_addCreateBlobOptionalHeaders($options, $headers);
     $this->addOptionalQueryParam($queryParams, Resources::QP_TIMEOUT, $options->getTimeout());
     $response = $this->send($method, $headers, $queryParams, $postParams, $path, $statusCode);
     return CopyBlobResult::create($response->getHeader());
 }
コード例 #23
0
 /**
  * Fill locator from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['ExpirationDateTime'])) {
         Validate::isDateString($options['ExpirationDateTime'], 'options[ExpirationDateTime]');
         $this->_expirationDateTime = new \DateTime($options['ExpirationDateTime']);
     }
     if (isset($options['Type'])) {
         Validate::isInteger($options['Type'], 'options[Type]');
         $this->_type = $options['Type'];
     }
     if (isset($options['Path'])) {
         Validate::isValidUri($options['Path'], 'options[Path]');
         $this->_path = $options['Path'];
     }
     if (isset($options['BaseUri'])) {
         Validate::isValidUri($options['BaseUri'], 'options[BaseUri]');
         $this->_baseUri = $options['BaseUri'];
     }
     if (isset($options['ContentAccessComponent'])) {
         Validate::isString($options['ContentAccessComponent'], 'options[ContentAccessComponent]');
         $this->_contentAccessComponent = $options['ContentAccessComponent'];
     }
     if (isset($options['AccessPolicyId'])) {
         Validate::isString($options['AccessPolicyId'], 'options[AccessPolicyId]');
         $this->_accessPolicyId = $options['AccessPolicyId'];
     }
     if (isset($options['AssetId'])) {
         Validate::isString($options['AssetId'], 'options[AssetId]');
         $this->_assetId = $options['AssetId'];
     }
     if (isset($options['StartTime'])) {
         Validate::isDateString($options['StartTime'], 'options[StartTime]');
         $this->_startTime = new \DateTime($options['StartTime']);
     }
 }
コード例 #24
0
ファイル: BrokerProperties.php プロジェクト: mat33470/PFA
 /** 
  * Sets an integer value in an array. 
  *
  * @param array  &$valueArray The array of a set of values. 
  * @param string $key         The key of the key value pair. 
  * @param int    $value       The value of the key value pair. 
  * 
  * @return none
  */
 public function setValueArrayInt(&$valueArray, $key, $value)
 {
     Validate::isArray($valueArray, 'valueArray');
     Validate::isString($key, 'key');
     if (!empty($value)) {
         Validate::isInteger($value, 'value');
         $valueArray[$key] = $value;
     }
 }
コード例 #25
0
 /**
  * Sets blob contentLength.
  *
  * @param integer $contentLength value.
  *
  * @return none.
  */
 public function setContentLength($contentLength)
 {
     Validate::isInteger($contentLength, 'contentLength');
     $this->_contentLength = $contentLength;
 }
コード例 #26
0
ファイル: Asset.php プロジェクト: bitmovin/azure-sdk-for-php
 /**
  * Fill asset from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['State'])) {
         Validate::isInteger($options['State'], 'options[State]');
         $this->_state = $options['State'];
     }
     if (isset($options['Created'])) {
         Validate::isDateString($options['Created'], 'options[Created]');
         $this->_created = new \DateTime($options['Created']);
     }
     if (isset($options['LastModified'])) {
         Validate::isDateString($options['LastModified'], 'options[LastModified]');
         $this->_lastModified = new \DateTime($options['LastModified']);
     }
     if (isset($options['AlternateId'])) {
         Validate::isString($options['AlternateId'], 'options[AlternateId]');
         $this->_alternateId = $options['AlternateId'];
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['Options'])) {
         Validate::isInteger($options['Options'], 'options[Options]');
         $this->_options = $options['Options'];
     }
     if (isset($options['Uri'])) {
         Validate::isValidUri($options['Uri'], 'options[Uri]');
         $this->_uri = $options['Uri'];
     }
     if (isset($options['StorageAccountName'])) {
         Validate::isString($options['StorageAccountName'], 'options[StorageAccountName]');
         $this->_storageAccountName = $options['StorageAccountName'];
     }
 }
コード例 #27
0
 /**
  * @covers WindowsAzure\Common\Internal\Validate::isInteger
  */
 public function testIsIntegerWithNonInteger()
 {
     $this->setExpectedException(get_class(new InvalidArgumentTypeException('')));
     Validate::isInteger(new \DateTime(), 'integer');
 }
コード例 #28
0
 /**
  * Fill AssetDeliveryPolicy from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return void
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['AssetDeliveryProtocol'])) {
         Validate::isInteger($options['AssetDeliveryProtocol'], 'options[AssetDeliveryProtocol]');
         $this->_protocol = $options['AssetDeliveryProtocol'];
     }
     if (isset($options['AssetDeliveryPolicyType'])) {
         Validate::isInteger($options['AssetDeliveryPolicyType'], 'options[AssetDeliveryPolicyType]');
         $this->_policyType = $options['AssetDeliveryPolicyType'];
     }
     if (isset($options['AssetDeliveryConfiguration'])) {
         Validate::isString($options['AssetDeliveryConfiguration'], 'options[AssetDeliveryConfiguration]');
         $this->_configuration = $options['AssetDeliveryConfiguration'];
     }
     if (isset($options['Created'])) {
         Validate::isDateString($options['Created'], 'options[Created]');
         $this->_created = new \DateTime($options['Created']);
     }
     if (isset($options['LastModified'])) {
         Validate::isDateString($options['LastModified'], 'options[LastModified]');
         $this->_lastModified = new \DateTime($options['LastModified']);
     }
 }
コード例 #29
0
 /**
  * Sets blob sequenceNumber.
  *
  * @param int $sequenceNumber value.
  *
  * @return none.
  */
 public function setSequenceNumber($sequenceNumber)
 {
     Validate::isInteger($sequenceNumber, 'sequenceNumber');
     $this->_sequenceNumber = $sequenceNumber;
 }
コード例 #30
0
 /**
  * Fill manifest from array
  *
  * @param array $options Array containing values for object properties
  *
  * @return none
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['State'])) {
         Validate::isInteger($options['State'], 'options[State]');
         $this->_state = $options['State'];
     }
     if (isset($options['Created'])) {
         Validate::isDateString($options['Created'], 'options[Created]');
         $this->_created = new \DateTime($options['Created']);
     }
     if (isset($options['LastModified'])) {
         Validate::isDateString($options['LastModified'], 'options[LastModified]');
         $this->_lastModified = new \DateTime($options['LastModified']);
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['BlobStorageUriForUpload'])) {
         Validate::isValidUri($options['BlobStorageUriForUpload'], 'options[BlobStorageUriForUpload]');
         $this->_blobStorageUriForUpload = $options['BlobStorageUriForUpload'];
     }
     if (isset($options['Statistics'])) {
         $this->_statistics = null;
         if (is_array($options['Statistics'])) {
             $this->_statistics = IngestManifestStatistics::createFromOptions($options['Statistics']);
         }
     }
     if (isset($options['StorageAccountName'])) {
         Validate::isString($options['StorageAccountName'], 'options[StorageAccountName]');
         $this->_storageAccountName = $options['StorageAccountName'];
     }
 }