/** * Fill storage account from array * * @param array $options Array containing values for object properties * * @return none */ public function fromArray($options) { if (isset($options['Name'])) { Validate::isString($options['Name'], 'options[Name]'); $this->_name = $options['Name']; } if (isset($options['IsDefault'])) { Validate::isBoolean($options['IsDefault'], 'options[IsDefault]'); $this->_isDefault = $options['IsDefault']; } }
/** * Fill ChannelSlate from array. * * @param array $options Array containing values for object properties */ public function fromArray($options) { if (isset($options['InsertSlateOnAdMarker'])) { Validate::isBoolean($options['InsertSlateOnAdMarker'], 'options[InsertSlateOnAdMarker]'); $this->_insertSlateOnAdMarker = (bool) $options['InsertSlateOnAdMarker']; } if (isset($options['DefaultSlateAssetId'])) { Validate::isString($options['DefaultSlateAssetId'], 'options[DefaultSlateAssetIdUrl]'); $this->_defaultSlateAssetId = $options['DefaultSlateAssetId']; } }
/** * Fill asset 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['ContentFileSize'])) { Validate::isString($options['ContentFileSize'], 'options[ContentFileSize]'); $this->_contentFileSize = $options['ContentFileSize']; } if (isset($options['ParentAssetId'])) { Validate::isString($options['ParentAssetId'], 'options[ParentAssetId]'); $this->_parentAssetId = $options['ParentAssetId']; } 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['ContentChecksum'])) { Validate::isString($options['ContentChecksum'], 'options[ContentChecksum]'); $this->_contentCheckSum = $options['ContentChecksum']; } }
/** * @covers WindowsAzure\Common\Internal\Validate::isBoolean */ public function testIsBooleanWithBoolean() { Validate::isBoolean(true); $this->assertTrue(true); }
/** * Sets the include metadata flag. * * @param bool $includeMetadata value. * * @return none. */ public function setIncludeMetadata($includeMetadata) { Validate::isBoolean($includeMetadata); $this->_includeMetadata = $includeMetadata; }
/** * Sets the include uncommittedBlobs flag. * * @param bool $includeUncommittedBlobs value. * * @return none. */ public function setIncludeUncommittedBlobs($includeUncommittedBlobs) { Validate::isBoolean($includeUncommittedBlobs); $this->_includeUncommittedBlobs = $includeUncommittedBlobs; }
/** * 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']; } }
/** * Sets blob deleteSnaphotsOnly. * * @param string $deleteSnaphotsOnly value. * * @return boolean. */ public function setDeleteSnaphotsOnly($deleteSnaphotsOnly) { Validate::isBoolean($deleteSnaphotsOnly); $this->_deleteSnaphotsOnly = $deleteSnaphotsOnly; }
/** * Sets treat warnings as errors flag. * * @param bool $treatWarningsAsErrors Indicates whether to treat package * validation warnings as errors. * * @return none */ public function setTreatWarningsAsErrors($treatWarningsAsErrors) { Validate::isBoolean($treatWarningsAsErrors, 'treatWarningsAsErrors'); $this->_treatWarningsAsErrors = $treatWarningsAsErrors; }
/** * Sets computeRangeMD5 * * @param boolean $computeRangeMD5 value * * @return none */ public function setComputeRangeMD5($computeRangeMD5) { Validate::isBoolean($computeRangeMD5); $this->_computeRangeMD5 = $computeRangeMD5; }
/** * Cancels an in progress configuration change (update) or upgrade and returns * the deployment to its state before the upgrade or configuration change was * started. * * Note that you can rollback update or upgrade 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 string $mode Specifies whether the rollback * should proceed automatically or not. Auto, The rollback proceeds without * further user input. Manual, You must call the walkUpgradeDomain API to apply * the rollback to each upgrade domain. * @param boolean $force Specifies whether the rollback * should proceed even when it will cause local data to be lost from some role * instances. True if the rollback should proceed; otherwise false if the * rollback should fail. * @param GetDeploymentOptions $options The optional parameters. * * @return none * * @see http://msdn.microsoft.com/en-us/library/windowsazure/hh403977.aspx */ public function rollbackUpdateOrUpgrade($name, $mode, $force, $options) { Validate::isString($name, 'name'); Validate::notNullOrEmpty($name, 'name'); Validate::isString($mode, 'mode'); Validate::isTrue(Mode::isValid($mode), Resources::INVALID_CHANGE_MODE_MSG); Validate::isBoolean($force, 'force'); Validate::notNullOrEmpty($force, 'force'); Validate::notNullOrEmpty($options, 'options'); $xmlElements = array(Resources::XTAG_MODE => $mode, Resources::XTAG_FORCE => Utilities::booleanToString($force)); $body = $this->_createRequestXml($xmlElements, Resources::XTAG_ROLLBACK_UPDATE_OR_UPGRADE); $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_ROLLBACK); $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()); }
/** * Sets the embed detail flag. * * @param boolean $embedDetail The embed detail flag. * * @return none */ public function setEmbedDetail($embedDetail) { Validate::isBoolean($embedDetail); $this->_embedDetail = $embedDetail; }