Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added OnApp_CDNResource_AvailableEdgeGroup adn OnApp_CDNResource_Avai…

…lableEdgeGroup_Location classes
  • Loading branch information...
commit 567260e5b4d7208d386db3a74fa117a92c82d86c 1 parent 2117dc8
Yuriy Yakubskiy authored
View
108 CDNResource/AvailableEdgeGroup.php
@@ -0,0 +1,108 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Represents Edge Groups Assigned to the current logined user's Billling Plan
+ *
+ *
+ * @category API WRAPPER
+ * @package OnApp
+ * @author Yakubskiy Yuriy
+ * @copyright (c) 2011 OnApp
+ * @link http://www.onapp.com/
+ * @see OnApp
+ */
+
+/**
+ * Managing Edge Groups
+ *
+ * The Available Edge Group class represents the Edge groups.
+ * The OnApp_CDNResource_AvailableEdgeGroup class is the parent of the OnApp class.
+ *
+ * The OnApp_CDNResource_AvailableEdgeGroup uses the following basic methods:
+ * {@link getList}.
+ *
+ */
+
+
+class OnApp_CDNResource_AvailableEdgeGroup extends OnApp {
+ /**
+ * root tag used in the API request
+ *
+ * @var string
+ */
+ var $_tagRoot = 'edge_group';
+
+ /**
+ * alias processing the object data
+ *
+ * @var string
+ */
+ var $_resource = 'cdn_resources/available_edge_groups';
+
+ public function __construct() {
+ parent::__construct();
+ $this->className = __CLASS__;
+ }
+
+ /**
+ * API Fields description
+ *
+ * @param string|float $version OnApp API version
+ * @param string $className current class' name
+ * @return array
+ */
+ public function initFields( $version = null, $className = '' ) {
+ switch( $version ) {
+ case '2.3':
+ $this->fields = array(
+ 'label' => array(
+ ONAPP_FIELD_MAP => '_label',
+ ONAPP_FIELD_REQUIRED => true,
+ ONAPP_FIELD_DEFAULT_VALUE => ''
+ ),
+ 'created_at' => array(
+ ONAPP_FIELD_MAP => '_created_at',
+ ONAPP_FIELD_TYPE => 'datetime',
+ ONAPP_FIELD_READ_ONLY => true
+ ),
+ 'updated_at' => array(
+ ONAPP_FIELD_MAP => '_updated_at',
+ ONAPP_FIELD_TYPE => 'datetime',
+ ONAPP_FIELD_READ_ONLY => true
+ ),
+ 'id' => array(
+ ONAPP_FIELD_MAP => '_id',
+ ONAPP_FIELD_TYPE => 'integer',
+ ONAPP_FIELD_READ_ONLY => true,
+ ),
+ 'edge_group_locations' => array(
+ ONAPP_FIELD_MAP => '_edge_group_locations',
+ ONAPP_FIELD_TYPE => 'array',
+ ONAPP_FIELD_CLASS => 'CDNResource_AvailableEdgeGroup_Location'
+ ),
+ );
+ break;
+ }
+
+ parent::initFields( $version, __CLASS__ );
+ return $this->fields;
+ }
+
+ /**
+ * Activates action performed with object
+ *
+ * @param string $action_name the name of action
+ *
+ * @access public
+ */
+ function activate( $action_name ) {
+ switch( $action_name ) {
+ case ONAPP_ACTIVATE_LOAD:
+ case ONAPP_ACTIVATE_SAVE:
+ case ONAPP_ACTIVATE_DELETE:
+ exit( 'Call to undefined method ' . __CLASS__ . '::' . $action_name . '()' );
+ break;
+ }
+ }
+}
View
131 CDNResource/AvailableEdgeGroup/Location.php
@@ -0,0 +1,131 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Represents OnApp CDNResource AvailableEdgeGroup Locations
+ *
+ * @category API WRAPPER
+ * @package OnApp
+ * @subpackage CDNResource_AvailableEdgeGroup
+ * @author Yakubskiy Yuriy
+ * @copyright (c) 2012 OnApp
+ * @link http://www.onapp.com/
+ * @see OnApp
+ */
+
+/**
+ * CDN Origins For API
+ *
+ * The OnApp_CDNResource_AvailableEdgeGroup_Location class doesn't support any basic method.
+ *
+ */
+
+
+class OnApp_CDNResource_AvailableEdgeGroup_Location extends OnApp {
+ /**
+ * root tag used in the API request
+ *
+ * @var string
+ */
+ var $_tagRoot = 'edge_group_location';
+
+ /**
+ * alias processing the object data
+ *
+ * @var string
+ */
+ var $_resource = '';
+
+ public function __construct() {
+ parent::__construct();
+ $this->className = __CLASS__;
+ }
+
+ /**
+ * API Fields description
+ *
+ * @param string|float $version OnApp API version
+ * @param string $className current class' name
+ * @return array
+ */
+ public function initFields( $version = null, $className = '' ) {
+ switch( $version ) {
+ case '2.0':
+ case '2.1':
+ break;
+
+ case 2.2:
+ case 2.3:
+ $this->fields = array(
+ 'price' => array(
+ ONAPP_FIELD_MAP => '_price',
+ ONAPP_FIELD_TYPE => 'string',
+ ONAPP_FIELD_READ_ONLY => true,
+ ),
+ 'city' => array(
+ ONAPP_FIELD_MAP => '_city',
+ ONAPP_FIELD_TYPE => 'string',
+ ONAPP_FIELD_READ_ONLY => true,
+ ),
+ 'created_at' => array(
+ ONAPP_FIELD_MAP => '_created_at',
+ ONAPP_FIELD_TYPE => 'string',
+ ONAPP_FIELD_READ_ONLY => true,
+ ),
+ 'updated_at' => array(
+ ONAPP_FIELD_MAP => '_updated_at',
+ ONAPP_FIELD_TYPE => 'string',
+ ONAPP_FIELD_READ_ONLY => true,
+ ),
+ 'country' => array(
+ ONAPP_FIELD_MAP => '_country',
+ ONAPP_FIELD_TYPE => 'string',
+ ONAPP_FIELD_READ_ONLY => true,
+ ),
+ 'aflexi_location_id' => array(
+ ONAPP_FIELD_MAP => '_aflexi_location_id',
+ ONAPP_FIELD_TYPE => 'integer',
+ ONAPP_FIELD_READ_ONLY => true,
+ ),
+ 'id' => array(
+ ONAPP_FIELD_MAP => '_id',
+ ONAPP_FIELD_TYPE => 'integer',
+ ONAPP_FIELD_READ_ONLY => true,
+ ),
+ 'operator' => array(
+ ONAPP_FIELD_MAP => '_operator',
+ ONAPP_FIELD_TYPE => 'string',
+ ONAPP_FIELD_READ_ONLY => true,
+ ),
+ 'edge_group_id' => array(
+ ONAPP_FIELD_MAP => '_edge_group_id',
+ ONAPP_FIELD_TYPE => 'integer',
+ ONAPP_FIELD_READ_ONLY => true,
+ ),
+ );
+ $this->fields = $this->initFields( 2.1 );
+ break;
+ }
+
+ parent::initFields( $version, __CLASS__ );
+ return $this->fields;
+ }
+
+ /**
+ * Activates action performed with object
+ *
+ * @param string $action_name the name of action
+ *
+ * @access public
+ */
+ function activate( $action_name ) {
+ switch( $action_name ) {
+ case ONAPP_ACTIVATE_GETLIST:
+ case ONAPP_ACTIVATE_LOAD:
+ case ONAPP_ACTIVATE_SAVE:
+ case ONAPP_ACTIVATE_DELETE:
+ exit( 'Call to undefined method ' . __CLASS__ . '::' . $action_name . '()' );
+ break;
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.